<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
	<meta charset="utf-8">
    <title>Available Truck Page</title>
<?php echo link_tag(my_url().'skin.css'); ?>
<script type="text/javascript" src="<?php echo my_url(); ?>js/1.js"></script>
<script type="text/javascript" src="../js/1.js"></script>
<script src="<?php echo my_url(); ?>js/AC_RunActiveContent.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
 var BaseURL='<?php echo base_url(); ?>';
function confirmDelete(at_id){
	
	var x= window.confirm("Are you sure to delete this item?");
	if(x){
		window.location.href = BaseURL + "at/delete_at/" + at_id;
	}	
}

</script>

<link rel="stylesheet" href="../skin.css" type="text/css" media="screen" /><meta name="author" content="Jaypee Mahilum" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link href="skin.css" rel="stylesheet" type="text/css" />
</head>

<?php



//echo $_SESSION['administrator_log']."============";
if(!isset($_SESSION['administrator_log']))
{
		echo"Log in first to access this page<html><title>WARNING</title><body><br><a href='".base_url()."administrator' />click here to log in.</a></body></html>";
}
else
{
?>
<body >


	<div class="BodyCover">
	 		<div class="ParentContent">
	        <?php require("at_menu.php"); ?>
			<div class="MenuTab">

    			<div class="MenuBelow"><img src="<?php echo my_url();?>images/below-menu.gif"></div>        

             </div>
	   <div class="title">
			   <h1>Available Truck List:</h1>
            </div>                      

			<div class="module-index1">
		  		<div align="right"><a href="<?php echo base_url()?>admin/logout" style="color:#FF0000;">logout</a></div><br/>
  	                <?php if (isset($recordflag)) {echo $recordflag;}?>
                
                		 <a href="<?php echo base_url() . "at/add_at/" ?>">
         	<img src=" <?php echo my_url() ."images/icons/action_add.gif" ?>" style='border:none'/> Add New Data</a><br />
            <form action="<?php echo base_url(); ?>at/ddlistsort" method="post">
				<fieldset>
					<label><b>Sort by:</b></label>
						<select id="search" name="search">
						
						<?php if(isset($search)) {?>
								<?php if ($search=='drop_off_city') {?>
									<option value="drop_off_city" selected='selected'>City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								<?php } if ($search=='drop_off_state') {?>	
									<option value="drop_off_city">City</option>
									<option value="drop_off_state" selected='selected'>State</option>
									<option value="drop_off_date">Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								<?php }if ($search=='drop_off_date'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  selected='selected'>Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								<?php }if ($search=='des_city'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date" >Date</option>
									<option value="des_city"  selected='selected'>Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								<?php }if ($search=='des_state'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state" selected='selected'>Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								<?php }if ($search=='des_zone'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone" selected='selected'>Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								<?php }if ($search=='drop_off_date,drop_off_state'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state" selected='selected'>Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
								
								<?php }if ($search=='drop_off_date,des_state'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state"selected='selected'>Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>	
									
								<?php }if ($search=='drop_off_date,des_zone'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone" selected='selected'>Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>	
									
								<?php }if ($search=='dv_company_name'){ ?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name"selected='selected'>D/V Company Name</option>	
						<?php }} else {?>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="des_city">Des : City</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date,drop_off_state">Date & State</option>
									<option value="drop_off_date,des_state">Date & Des_State</option>
									<option value="drop_off_date,des_zone">Date & Des_Zone</option>
									<option value="dv_company_name">D/V Company Name</option>
						<?php } ?>
						</select> 
						
						
					<input type="submit" value="Go" id="Search" />
				</fieldset>
		    </form>
          <br />	
			<div style='overflow:scroll;width:940px;height:400px;border:1pt solid #000;'>
                <table class='Grid' width='940px' border='1'>
                  <tr>
                        <th nowrap="nowrap">Vw</th>
                        <th nowrap="nowrap">Ed</th>
                        <th nowrap="nowrap">Dt</th>
                        <th nowrap="nowrap">Load No.</th>
                        <th nowrap="nowrap">Phone Number</th>
                        <th nowrap="nowrap">Name</th>
                        <th nowrap="nowrap">D/V Company Name </th>                        
                        <th nowrap="nowrap">City</th>
						<th nowrap="nowrap">State</th>
                        <th nowrap="nowrap">Date</th>
                        <th nowrap="nowrap">Truck </th>                        
                        <th nowrap="nowrap">MC #</th>
                        <th nowrap="nowrap">Des_City </th>                        
                        <th nowrap="nowrap">Des_State </th>                        
                        <th nowrap="nowrap">Des_Zone </th>
                        <th nowrap="nowrap">Select </th>                        
                  </tr>
<?php
        		  $_rowClass = 'tr_odd';
                foreach($list_at as $row)
                {
                         $load_no = $row->load_no;
						 $cell_phone_num = $row->cell_phone_num;						 
						 $f_name = $row->f_name;
						 $dv_company_name = $row->dv_company_name;
						 $drop_off_city = $row->drop_off_city;
						 $drop_off_state = $row->drop_off_state;
						 $drop_off_date = $row->drop_off_date;
						 $type_of_truck = $row->type_of_truck;
						 $mc_num = $row->mc_num;
						 $des_city = $row->des_city;
						 $des_state = $row->des_state;
						 $des_zone = $row->des_zone;						 						 
						 $select = $row->select;						 						 						 				 
?>					
					<tr class="<?php echo $_rowClass ?>"<?php echo GetTrEffects()?>>
						  	<td width='5'>
                                <a href="<?php echo base_url() . "at/view_at/" .$row->at_id ?>">
                                	<img src="<?php echo my_url() . "images/icons/view.gif" ?>" style='border:none' />
                                </a>
							</td>
                        	<td width='5'>
                        	<a href="<?php echo base_url() . "at/edit_at/" . $row->at_id ?>">
                            	<img src="<?php echo my_url() . "images/icons/edit.gif" ?>" style='border:none' />
                             </a>
							</td>
                            
                             <td width='5'>
                            	<a href="javascript:void(0)" onclick="confirmDelete(<?php echo $row->at_id ?>);" >
								<img src="<?php echo my_url() . "images/icons/delete.gif" ?>" style='border:none' />
							</a>
						</td>
                        
							<td nowrap="nowrap"><?php echo $load_no ?></td>
                           	<td nowrap="nowrap"><?php echo $cell_phone_num?></td>                        	
                            <td nowrap="nowrap"><?php echo $f_name?></td>
							<td nowrap="nowrap"><?php echo $dv_company_name?></td>
            	            <td nowrap="nowrap"><b><?php echo $drop_off_city?></b></td>
							<td nowrap="nowrap"><b><?php echo $drop_off_state?></b></td>
							<td nowrap="nowrap"><b><?php echo $drop_off_date?></b></td>
            	            <td nowrap="nowrap"><?php echo $type_of_truck?></td>
            	            <td nowrap="nowrap"><?php echo $mc_num?></td>
                	        <td nowrap="nowrap"><?php echo $des_city?></td>
                    	    <td nowrap="nowrap"><?php echo $des_state?></td>
                	        <td nowrap="nowrap"><?php echo $des_zone?></td>
                            <td nowrap="nowrap"><?php echo $select?></td>                            
                  </tr>
<?php                  
				  if($_rowClass=="tr_odd") $_rowClass="tr_even"; else $_rowClass="tr_odd";     
                 }
?>
                 </table>
                 
                 </div> 
       
    		<br />
			<br />
			    		
		    <div class="Footer1">	
                <div class="Footer">Copyright &copy; 2011. All Rights Reserved <br><br>
                 <a href="http://webmartis.com"> <img src="<?php echo my_url();?>/images/wmlink.png"></a>
                 
                </div>                
            </div> <!---end of Footer1 ---->        
            
		</div><!---end of ParentContent ---->
    </div> <!---end of BodyCover ---->
 
</body>
<?php } ?>
</html>

